/*=========================================================================

 Program:   BlueBerry Platform
 Language:  C++
 Date:      $Date: 2010-01-17 02:57:43 +0800 (周日, 17 一月 2010) $
 Version:   $Revision: 21070 $

 Copyright (c) German Cancer Research Center, Division of Medical and
 Biological Informatics. All rights reserved.
 See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.

 This software is distributed WITHOUT ANY WARRANTY; without even
 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.  See the above copyright notices for more information.

 =========================================================================*/


#ifndef BERRYGUITKIMENULISTENER_H_
#define BERRYGUITKIMENULISTENER_H_

#include <berryObject.h>
#include <berryMacros.h>

#include <berryMessage.h>

#include "../berryUiDll.h"

namespace berry
{

namespace GuiTk
{

/**
 * Classes which implement this interface provide methods
 * that deal with the events that are generated by moving
 * and resizing controls.
 * <p>
 * After creating an instance of a class that implements
 * this interface it can be added to a control using the
 * <code>addControlListener</code> method and removed using
 * the <code>removeControlListener</code> method. When a
 * control is moved or resized, the appropriate method will
 * be invoked.
 * </p>
 *
 * @see ControlAdapter
 * @see ControlEvent
 */
struct BERRY_UI IMenuListener: public virtual Object
{

  berryInterfaceMacro(IMenuListener, berry);

  struct Events {

    typedef Message<> MenuEvent;

    MenuEvent menuAboutToShow;
    MenuEvent menuAboutToHide;

    void AddListener(IMenuListener::Pointer listener);
    void RemoveListener(IMenuListener::Pointer listener);

  private:
    typedef MessageDelegate<IMenuListener> Delegate;
  };

    /**
     * Notifies this listener that the menu is about to be shown by
     * the given menu manager.
     *
     * @param manager the menu manager
     */
   virtual void MenuAboutToShow() = 0;

  /**
   * Notifies this listener that the menu is about to be hidden by
   * the given menu manager.
   *
   * @param manager the menu manager
   */
  virtual void MenuAboutToHide() = 0;
};

}

}

#endif /* BERRYGUITKIMENULISTENER_H_ */
